{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1.0, 0.5, 0.3333333333333333, 0.25, 0.2, 0.16666666666666666, 0.14285714285714285, 0.125, 0.1111111111111111, 0.1, 0.09090909090909091, 0.08333333333333333, 0.07692307692307693, 0.07142857142857142, 0.06666666666666667, 0.0625, 0.058823529411764705, 0.05555555555555555, 0.05263157894736842, 0.05]\n",
      "3.597739657143682\n"
     ]
    }
   ],
   "source": [
    "n2=[1/i for i in range(1,20+1)]\n",
    "print(n2)\n",
    "print(sum(n2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-1.0, 0.5, -0.3333333333333333, 0.25, -0.2, 0.16666666666666666, -0.14285714285714285, 0.125, -0.1111111111111111, 0.1, -0.09090909090909091, 0.08333333333333333, -0.07692307692307693, 0.07142857142857142, -0.06666666666666667, 0.0625, -0.058823529411764705, 0.05555555555555555, -0.05263157894736842, 0.05]\n",
      "-0.6687714031754279\n"
     ]
    }
   ],
   "source": [
    "n2=[1/i if i%2==0 else -1/i for i in range(1,20+1)]\n",
    "print(n2)\n",
    "print(sum(n2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1.0, -0.3333333333333333, 0.2, -0.14285714285714285, 0.1111111111111111, -0.09090909090909091, 0.07692307692307693, -0.06666666666666667, 0.058823529411764705, -0.05263157894736842]\n",
      "0.7604599047323508\n"
     ]
    }
   ],
   "source": [
    "n2=[1/i if (i-1)/2%2==0 else -1/i for i in range(1,20+1,2)]\n",
    "print(n2)\n",
    "print(sum(n2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1.0, -0.3333333333333333, 0.2, -0.14285714285714285, 0.1111111111111111, -0.09090909090909091, 0.07692307692307693, -0.06666666666666667, 0.058823529411764705, -0.05263157894736842]\n",
      "0.7604599047323508\n"
     ]
    }
   ],
   "source": [
    "n2=[1/i if (i-1)%4==0 else -1/i for i in range(1,20+1,2)]\n",
    "print(n2)\n",
    "print(sum(n2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "72\n"
     ]
    }
   ],
   "source": [
    "n=int(input())\n",
    "s=\"\"\n",
    "summ=0\n",
    "for i in range(1,n+1):\n",
    "    s+=\"6\"\n",
    "    summ+=int(s)\n",
    "print(summ)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "738\n"
     ]
    }
   ],
   "source": [
    "print(sum([int(\"6\"*i) for i in range(1,1+int(input()))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12345.68  \n"
     ]
    }
   ],
   "source": [
    "print(format(12345.678,\"<10.2f\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  12345.68\n"
     ]
    }
   ],
   "source": [
    "print(format(12345.678,\"10.2f\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  12345678\n"
     ]
    }
   ],
   "source": [
    "print(format(12345678,\">10d\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  asfdgd  \n"
     ]
    }
   ],
   "source": [
    "print(format(\"asfdgd\",\"^10s\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x=      2 y=       1\n"
     ]
    }
   ],
   "source": [
    "print(\"x={1:7d} y={0:8d}\".format(1,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.2\n"
     ]
    }
   ],
   "source": [
    "print(n2[2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    }
   ],
   "source": [
    "s=[1,2,'a','b']\n",
    "print(s[1])\n",
    "#print(min(s))\n",
    "#print(int('a'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2, 3, 10000, 7, 11, 13]\n",
      "[13, 11, 7, 5, 3, 2]\n",
      "[2, 3, 10000, 7, 11, 13]\n"
     ]
    }
   ],
   "source": [
    "a=[2,3,5,7,11,13]\n",
    "b=a[::-1]\n",
    "a[2]=10000\n",
    "print(a)\n",
    "print(b)\n",
    "print(a[:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "上\n",
      "学\n"
     ]
    }
   ],
   "source": [
    "print(min(\"好好学习天天向上\"))\n",
    "print(max(\"好好学习天天向上\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello\\n\n"
     ]
    }
   ],
   "source": [
    "print(r\"hello\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Aafghnjkkmkm\n"
     ]
    }
   ],
   "source": [
    "s=\"aaFGHnjkkmkm\"\n",
    "s=s.title()\n",
    "print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Invalid format specifier",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-21-08cf621039d9>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"{:20d,}\"\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m12345678901\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m: Invalid format specifier"
     ]
    }
   ],
   "source": [
    "print(\"{:20,}\".format(12345678901))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "asdsfd\n",
      "12\n",
      "3\n",
      "56\n",
      "6\n"
     ]
    }
   ],
   "source": [
    "maxx=0\n",
    "for i in range(4):\n",
    "    s=input()\n",
    "    if len(s)>maxx:\n",
    "        maxx=len(s)\n",
    "print(maxx)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
